package cn.ml.springdemo.annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestAnnotation {
    public static void main(String[] args) {

        ApplicationContext ac = new ClassPathXmlApplicationContext("ac2.xml");
        //为person起了别名@Component("person2")
        Person person = (Person) ac.getBean("person2");
        System.out.println(person);
        F f = ac.getBean(F.class);
        f.say();
        //System.out.println("************************************************");
        f.show();
        f.myError();
    }
}
